#ifndef __TEST__H__
#define __TEST__H__

#if _MSC_VER > 1000
#pragma once
#endif

#include "Testable.h"

typedef int (*Func)();

using namespace AllTing;

namespace AllTing
{

namespace Test
{

class TestFactory;

class Test : public Testable
{
private:
	Test(::Func func, const Char* pszName, const Bool bSelect=true, const Bool bStopOnFailed=false) : Testable(pszName, bSelect, bStopOnFailed), func_(func), pTestee_(0), testee_(0)
	{
	}
	Test(Testable* pTestee, Testable::Testee testee, const Char* pszName, const Bool bSelect=true, const Bool bStopOnFailed=false) : Testable(pszName, bSelect, bStopOnFailed), func_(0), pTestee_(pTestee), testee_(testee)
	{
	}
	Test(const Test& aTest);
public:
	Test& operator=(const Test& aTest);
	virtual ~Test();
	
	virtual Bool Run();

	bool operator ==(const Test &T) const
	{
		return (strName_ == T.strName_ && 
				bSelected_ == T.bSelected_ && 
				nError_ == T.nError_ &&
				nCurrentTime_ == T.nCurrentTime_ &&
				nElapsedTime_ == T.nElapsedTime_ &&
				bStopOnFailed_ == T.bStopOnFailed_ &&
				func_ == T.func_ &&
				testee_ == T.testee_);
	}

	friend class TestFactory;

protected:
	::Func func_;
	Testable* pTestee_;
	Testee testee_;
};

}	//namespace Test

}	//namespace AllTing

#endif